<template>
	<view class="">
		<view class="pd pt20 pm20 bgff bbm">
			<view class="display-flex cen">
				<view class="flex-1 fz32" @tap="jxxzcfd(sd)" v-for="sd in jmxcsd">
					<text class="pr" :class="sd.cls?'xzczxetry':''">{{sd.label}}</text>
				</view>
			</view>
		</view>
		<view class=" mt20 bgff" >

		<template v-for="sd in jxczxcdf">
			<view class="btm display-flex pd pt20 pm20">
				<view class="flex-1">
					<view class="fz32">
						{{sd.recordTypeName}}
					</view>
					<view class="mt10 z9 fz24">
						{{sd.createTime}}
					</view>
				</view>
				<view class="fz40 vertical-center red" v-if="sd.type==1">
					+{{sd.balance}}
				</view>
				<view class="fz40 vertical-center ls" v-if="sd.type==2">
					-{{sd.balance}}
				</view>
			</view>
		</template>
			
		</view>
		<view class=" mt20 bgff" v-if="jxczxcdf.length<=0">
			<view class="cen pt20 pm20 vertical-center">
				<view class="">
					<image src="../../static/img/noData.png" class="xczxcertfdgtrr"></image>
					<view class="mt20 z9 fz24">
						暂无数据!
					</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script lang="ts" setup>
	import { ref } from "vue"
	import { hf, hfer, hfsan, dxrequest, VerifyTheLogin } from "@/util/index.js"
	import { onShow, onLoad } from "@dcloudio/uni-app"
	const idxs = ref(0)
	const type = ref()
	const jxczxcdf = ref([])
	const jmxcsd = ref([
		{
			label: "全部",
			value: 0,
			cls: "act"
		}, {
			label: "收入",
			value: 1,
			cls: ""
		}, {
			label: "支出",
			value: 2,
			cls: ""
		},
	])
	const jxxzcfd = (data) => {
		idxs.value = data.value
		jmxcsd.value.map(a => {
			a.cls = ""
		})
		data.cls = "act"
		type.value = data.value
		initss()
	}
	const initss = async () => {
		uni.showLoading({
			title:"加载中"
		})
		const { data } = await dxrequest("/api/userbalancelog/page",
			{				isPass:2,
				type: type.value,
				page: 1,
				limit: 999
			})
		console.log(data)
		jxczxcdf.value = data.list
		uni.hideLoading()
	}
	onLoad(() => {
		initss()
	})
</script>

<style scoped>

</style>